Skip to main content

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds... Summary and analysis of solutions

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL serverversion for the right syntax to use near USING BTREE )ENGINE = InnoDB CHARACTER SET = utf8 COLLATE =utf8 general ci RO' at line 4

[Err] SET NAMES utf8;

The problem I encountered was that I reported error 1064 when importing sql files into Navicat. When searching for solutions to the problem, I saw some solutions from others, but none of them solved my problem. Let me first explain that my final solution was to change the MySQL version . Below Here are some solutions I've seen:

The first is about backticks and single quotes:

It looks the same, but the symbols are just wrong. For example, when creating the id username password email, something similar to a single quote is entered incorrectly, and the SQL statement cannot be executed.

Also, the values ​​in values ​​are not in backticks, but in single quotes, which is easy to confuse.

The second one is about field length:

One is that the corresponding field length is not specified, and the other is that the field length needs to be deleted in the code due to version issues, for example: replace all datetime(0) with datetime.

None of the above problems have solved my 1064 error. Next, I will talk about my error generation process and solution.

When I import the sql file into Navicat, I get error 1064.

First of all, in order to complete the school curriculum design, I found free information from the Internet. When importing its SQL file into Navicat, the first problem that occurred was

[Err] 1115 - Unknown character set: 'utf8mb4'
[Err] SET NAMES utf8mb4.

The reason for this problem is that the version problem code is MySQL8.0. The code does not match the MySQL version in your computer. Others say that you can edit the sql file and change utf8mb4 to 8.

I've been stuck here for a whole afternoon and tried various methods to no avail, such as changing the database properties, checking the check box before importing, checking the middle check box or not checking the box (the teaching video corresponding to the deployment file is all checked), and less The result of checking a hook is as follows:

Not ticking or hooking are both equally wrong.

Finally my solution was

The problem was solved after replacing it with the latest version of MySQL (8.0).

The MySQL 5.0 installed by the school teacher before was too old. The version iteration speed in the IT industry is so fast. I still hope that all coders (especially college students) will update their software versions in time to avoid basic version problems. A lot of wasted effort occurred.